using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using T2.WebSecurity.Data.Entities.Interfaces;
using T2.WebSecurity.Data.Entities;
using T2.WebSecurity.Business.Entities.Interfaces;
using T2.WebSecurity.Business.Entities;
using T2.WebSecurity.Business.Entities.Search.Interfaces;
using T2.WebSecurity.Data.Entities.Search.Interfaces;
using T2.WebSecurity.Data.Entities.Search;


//--Change Management Control - Application Business Translator  --**********************
//--Created By: trooks
//--Description: Application Translator
//--Created Date: 03/07/2013 10:48:58
//--*************************************************************

namespace T2.WebSecurity.Business.Translators
{
	public static class ApplicationTranslator 
	{
		public static IApplication TranslateToDataLayer(IApplication_biz _translateFrom)
        {
            IApplication temp = new Application();

		
			if(_translateFrom != null)
			{
			temp.Action = _translateFrom.Action;
			temp.Caller = _translateFrom.Caller;
			temp.Role = _translateFrom.Role;
			temp.PageSize = _translateFrom.PageSize;
			temp.PageNumber = _translateFrom.PageNumber;
			temp.SortColumn = _translateFrom.SortColumn;
			temp.SortType = _translateFrom.SortType;
			temp.TotalRows = _translateFrom.TotalRows;
			temp.ApplicationID = _translateFrom.ApplicationID;
			temp.ApplicationName = _translateFrom.ApplicationName;
			temp.TS = _translateFrom.TS;
			temp.CreatedBy = _translateFrom.CreatedBy;
			temp.CreatedDt = _translateFrom.CreatedDt;
			temp.ModifiedBy = _translateFrom.ModifiedBy;
			temp.ModifiedDt = _translateFrom.ModifiedDt;
			}
            return temp;
        }
		
		public static IApplicationSearch TranslateSearchToDataLayer(IApplicationSearch_biz _translateFrom)
        {
            IApplicationSearch temp = new ApplicationSearch();
		
			if(_translateFrom != null)
			{
			temp.Action = _translateFrom.Action;
			temp.Caller = _translateFrom.Caller;
			temp.Role = _translateFrom.Role;
			temp.PageSize = _translateFrom.PageSize;
			temp.PageNumber = _translateFrom.PageNumber;
			temp.SortColumn = _translateFrom.SortColumn;
			temp.SortType = _translateFrom.SortType;
			temp.TotalRows = _translateFrom.TotalRows;
			temp.ApplicationName = _translateFrom.ApplicationName;
			}
            return temp;
        }

        public static IApplication_biz TranslateFromDataLayer(IApplication _translateFrom)
        {
            IApplication_biz temp = new Application_biz();
			if(_translateFrom != null)
			{
			temp.Action = _translateFrom.Action;
			temp.Caller = _translateFrom.Caller;
			temp.Role = _translateFrom.Role;
			temp.PageSize = _translateFrom.PageSize;
			temp.PageNumber = _translateFrom.PageNumber;
			temp.SortColumn = _translateFrom.SortColumn;
			temp.SortType = _translateFrom.SortType;
			temp.TotalRows = _translateFrom.TotalRows;
			temp.ApplicationID = _translateFrom.ApplicationID;
			temp.ApplicationName = _translateFrom.ApplicationName;
			temp.TS = _translateFrom.TS;
			temp.CreatedBy = _translateFrom.CreatedBy;
			temp.CreatedDt = _translateFrom.CreatedDt;
			temp.ModifiedBy = _translateFrom.ModifiedBy;
			temp.ModifiedDt = _translateFrom.ModifiedDt;
			}
            return temp;
        
        }
	
	}
	
}
